<extend name="work/base"/>
<block name="content">
    <notempty  name="user_list">
        <form class="layui-form inline-form">
            <div class="pull-left">
                <div class="layui-inline dropdown">
                    <select name="status" lay-search lay-filter="uid">
                        <option value="">选择人员</option>
                        <volist name="user_list" id="vo" key="k">
                            <option value="{$vo.uid}"> {$vo.nickname}</option>
                        </volist>
                    </select>
                </div>

            </div>
        </form>
    </notempty>
    <table class="layui-table text-center" id="list" lay-filter="list" list-url="{:url('/userwork/financial/araplists')}"
           edit-url="{:url('/project/financial/finadd')}"
           del-url="{:url('/project/financial/delete')}"
           assigned-url="{:url('editcategory')}"
           delinfo-url="{:url('delete')}"></table>
</block>

<block name="script">
    <script type="text/html" id="titleTpl">
        <a href="{:url('/project/projectadmin/index/project_id/')}{{d.project_id}}" class="layui-table-link">{{d.title}}</a>
    </script>
    <script type="text/html" id="barDemo">
        <a class="layui-btn  layui-btn-xs " lay-event="edit"><i class="fa fa-pencil"></i> 编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete"> <i class="fa fa-trash-o"></i> 删除</a>
    </script>
    <script type="text/javascript">
        layui.use(['element', 'table', 'form'], function () {
            var table = layui.table
                , form = layui.form;
            table.render({
                elem: '#list'
                , url: "{:Url('/userwork/financial/araplists')}"
                , page: true
                , loading: true
                ,limit:20
                , cols: [[
                    {field: 'c_time', width: 190, title: '创建时间'}
                    , {field: 'title', width: 210,title: '项目名称',templet: '#titleTpl'}
                    , {field: 'financial_type', width: 90, title: '财务类型'}
                    , {field: 'price', width: 160, title: '金额',align:'right'}
                    , {field: 'remind_time', width: 180,title: '提醒时间'}
                    , {field: 'info',  title: '备注'}
                    , {fixed: 'right', width: 130, title: '操作', toolbar: '#barDemo'}
                    ]]
            });
            form.on('select(uid)', function (data) {
                table.reload('list', {
                    url: "{:Url('lists')}"
                    , page: {
                        curr: 1
                    }
                    , where: {
                        uid: data.value
                    }
                });
                return false;
            });
        });
    </script>
</block>
